//
//  LJHBaseTabbarViewController.m
//  HEARME
//
//  Created by mac on 16/3/2.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LJHBaseTabbarViewController.h"

@interface LJHBaseTabbarViewController ()

@end

@implementation LJHBaseTabbarViewController

-(void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [super dealloc];
}
-(void)changeColor:(NSNotification *)notifition
{
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"])
    {
        self.tabBar.backgroundColor = [UIColor colorWithWhite:0.451 alpha:1.000];
        
        
    }
    else
    {
        //        self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:202/255.0 green:222/255.0 blue:239/255.0 alpha:1];
        self.tabBar.backgroundColor = [UIColor whiteColor];
        
    }
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
        
        //            [self.navigationBar setBackgroundColor:[UIColor colorWithWhite:0.451 alpha:1.000]];
        self.tabBar.backgroundColor = [UIColor colorWithWhite:0.451 alpha:1.000];
    }
    else
    {
        self.tabBar.backgroundColor = [UIColor whiteColor];
        
    }
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
